package com.bytes.activemq;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.jms.annotation.JmsListener;

import javax.jms.JMSException;
import javax.jms.TextMessage;

@SpringBootApplication
//@EnableScheduling
public class QueueCustomer {
	//监听接收的方法
	@JmsListener(destination = "${my.queue.name}")
	public void consumerMsg(TextMessage textMessage) throws JMSException {
		String text = textMessage.getText();
		System.out.println("***消费者收到的消息:    " + text);
	}

	public static void main(String[] args) {
		SpringApplication.run(QueueCustomer.class);
	}
}


